package com.zzzyh.forumsystemclient.services;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zzzyh.forumsystemclient.model.ArchiveResponse;
import com.zzzyh.forumsystemclient.model.Article;
import com.zzzyh.forumsystemclient.model.CategoryPostResponse;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface IArticleService {
    List<Article> list(Integer pageNum, Integer pageSize);

    Integer total();

    List<Article> getCarousels();

    List<Article> getRecommends();

    Article getByArticleId(Long articleId);

    List<ArchiveResponse> getArchivedArticles();

    List<CategoryPostResponse> getCategoryWithArticles();

    List<Article> getArticlesByTagId(@Param("tagId") Integer tagId, @Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize);

    Integer totalByTagId(Integer tagId);

    Integer totalByCategoryId(Integer categoryId);

    List<Article> getArticlesByCategoryId(Integer categoryId, Integer pageNum, Integer pageSize);

    List<Article> getArticlesByUserId(Integer userId, Integer pageNum, Integer pageSize);

    Integer totalByUserId(Integer userId);

    List<Article> getMyLike(Integer pageNum, Integer pageSize, Integer userId);

    Integer getMyLikeTotal(Integer id);

    void like(Long articleId, Integer userId);

    Integer isLike(Long articleId, Integer userId);

    void unlike(Long articleId, Integer userId);

    Integer getArticleLikeTotal(Long articleId);

    void add(Article article);

    List<Article> getArticlesByKeyword(String keyword, Integer pageNum, Integer pageSize,Integer userId);

    Integer totalByKeyword(String keyword);

    List<Article> getArticlesByTitle(String title, Integer userId, Integer pageNum, Integer pageSize);

    Integer totalByTitle(String title, Integer userId);

    void addArticleQuantity(@Param("articleId") Long articleId);

    void update(@Param("article") Article article);

    void delete(@Param("articleId") Long articleId);
}
